<template>
  <el-dialog
    title="报警处理"
    width="600px"
    :visible.sync="visible"
    @close="$emit('update:show', false)"
    :show="show"
  >
    <el-form :inline="false" :model="formInline"  label-width="80px" class="demo-form-inline" ref="updateWarning">
      <el-form-item label="报警类型" prop="name">
        <el-input v-model="formInline.typeStr" placeholder="报警类型" disabled ></el-input>
      </el-form-item>
        <el-form-item label="手机号" prop="cellphone">
          <el-input v-model="formInline.cellphone" placeholder="手机号" disabled></el-input>
        </el-form-item>
      <el-form-item label="处理人" prop="userName" >
        <el-input v-model="formInline.handleName" placeholder="处理人" disabled></el-input>
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input type="textarea" v-model="formInline.remark"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
    <el-button @click="close('updateWarning')">取 消</el-button>
    <el-button type="primary" @click="sure('updateWarning')">确 定</el-button>
  </span>
  </el-dialog>
</template>

<script>
  import ShowMadal from '@/mixins/showmadal'
  import Cookies from 'js-cookie'
  export default {
    name: 'Updatewarning',
    mixins: [ShowMadal],
    props: {
      row: {
        type: Object,
        default: {}
      }
    },
    watch: {
      row: function() {
        this.formInline = this.row
        this.formInline.handleName=(Cookies.get('adminName'))? Cookies.get('adminName'):''
      }
    },
    data: function() {
      return {
        formInline: { }
      }
    },
    methods: {
      sure(formName) {
        this.$emit('submit', {formName: this.$refs[formName],remark:this.formInline.remark,id:this.row.id })
      },
      close(formName) {
        this.$emit('close', this.$refs[formName])
      }
    }
  }
</script>

<style scoped>

</style>
